// layout.tsx
import { NextIntlClientProvider, useMessages } from 'next-intl';
import { UserProvider } from './ctx';

type Props = {
  children: React.ReactNode;
  params: { locale: string };
};

export default function LocaleLayout({ children, params: { locale } }: Props) {
  const messages = useMessages();

  return (
    <NextIntlClientProvider locale={locale} messages={messages}>
      <UserProvider>
        {children}
      </UserProvider>
    </NextIntlClientProvider>
  );
}